<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="Trainercity v1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />
<title><?php echo $this->_var['page_title']; ?></title>
<link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" />

<?php echo $this->smarty_insert_scripts(array('files'=>'common.js,user.js')); ?>
<script type="text/javascript">


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1848127-18']);
  _gaq.push(['_setDomainName', '.fitwow.com']);
  _gaq.push(['_trackPageview']);


  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


</script></head>
<body>
<?php if ($this->_var['profile']['user_type'] == 1): ?>
 	    <?php echo $this->fetch('library/page_header.lbi'); ?>
        <div class="l_nav">
            <div class="l_nav_con">
                <ul>
                    <li><a href="user.php">My dashboard</a></li>
                    <li><a href="projects.php?act=my_clients_proposals">My client proposals</a></li>
                    <li><a href="user.php?act=profile" style="color: #FFFFFF; background-color: #CCCCCC" >Manage account</a></li>
                </ul>
            </div>
       </div>
       <div class="l_con mannge_acc">
       		<div class="right_posta" style="margin-top:20px;">
            	<ul >
                	<li><a href="projects.php?act=browse">Browse training projects</a></li>
                </ul>
      		</div>
            <div class="lcl_con2">
			  <form name="formAboutme_t" action="user.php" method="post" onSubmit="return edit_trainer()" >
            	<div class="lcl_con2_left" >
                	<ul>
                   	  <li class="font03 lclaccount">Account management</li>
                        <li class="lcl_cin1 "><a href="user.php?act=profile" class="font91">Account info</a></li>
                      <li class="font03 lclaccount" >Profile management</li>
                        <li class="lcl_bim "><a href="user.php?act=aboutme" class="font90">About me</a></li>
                        <li class="lcl_sj"></li>
                        <li class="lcl_cin1 "><a href="user.php?act=photo" class="font91">Profile photos</a></li>
                        <li class="lcl_sj"></li>
                        <li class="lcl_cin2 font91" ><a href="user.php" class="font91">Profile completed,go<br />to my dashboard</a></li>
                    </ul>
                </div>
                <div class="lcl_con2_right">
                	<div class="experien" style="border:1px solid #ccc;">
                    	<div class="experign">* Experiences</div>	
						<div>
                    	<p class="experign_xiaowen">I am a Personal trainer/Fitness Instructor	<br />
						<span>with</span><span>						
						<select id="experience" name="experience">
						<?php $_from = $this->_var['experience']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>
						<option value="<?php echo $this->_var['value']['xid']; ?>" ><?php echo $this->_var['value']['experienceType']; ?></option> 
						<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
						</select> 
						
						<script>
						document.getElementById("experience").value="<?php echo $this->_var['profile']['experience']; ?>";
			  			</script>
						</span>
						<span>Years experiences</span>
						</p>                   
						</div>
						<br />
						<br />
						<div class="experign">* Training Services I provide </div>
						
						<p class="experign_xiaowen" style="margin-bottom:10px;">					
						<select id="training_service" name="training_service">
						<?php $_from = $this->_var['trainingservice']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>	
						<option value="<?php echo $this->_var['value']['xid']; ?>" ><?php echo $this->_var['value']['trainingServiceType']; ?></option> 
						<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
						</select>
						<script>
						document.getElementById("training_service").value="<?php echo $this->_var['profile']['training_service']; ?>";
			  			</script>					
						</p>
                    	
							
                    </div>
                      	<div class="lcl_we2" style=" margin-top:30px;" >
                			<div class="lcl_we201">
                   	  			<div class="experign">* My Training Specialties tags (keywords)</div>
                        		<ul>
                        		<li style="width:250px;">
                        	  	<input name="" id="training_specialties" type="text" class="lcl_tet"  style="width:250px; height:26px; font-size:11px;"  value="" />								
                        		</li>
                            	<li style="padding-left:10px;">
								<input name="" type="button" class="l_bom03 font04" value="Add" onclick="javascript:add_specialties()" />
								<input type="hidden" name="training_specialties_value" id="training_specialties_value" value"<?php echo $this->_var['profile']['training_specialties']; ?>" />
								</li>
                        		</ul>
                        		<div class="keyowords" style="height:auto; line-height:normal;">Keywords (tags) must be separated by comma, such as ‘weight loss,’ or ‘yoga’ etc.<!--<div  class="lcl_ulli01" style="height:32px;" ><a href="#" onclick="most_tags()">Choose from the most used tags</a></div> -->
                       		 		</div>
									<div  id="specialties" class="lcl_ulli" style="float:left; display:block;margin-left:30px; margin-bottom:5px; color:#333333; font-size:16px;font-family:Arial; ">
                            			
                            		</div>
                   		 		</div>
                    	 		<div class="lcl_we202">
                    			<div class="experign">Credentials, Certificates  etc.</div>
								<div id="most_used_tags" style=" background-color:#999999; background-repeat:repeat; z-index:2; position:absolute; top: 500px; left:500px; display:none; width:300px; padding-top:5px; padding-left:5px; padding-bottom:5px; padding-right:5px;">								
								<?php $_from = $this->_var['most_specialties']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>
								<input type="checkbox" name="most_specialties" value="<?php echo $this->_var['value']['tag_name']; ?>"  /><?php echo $this->_var['value']['tag_name']; ?>
								<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
								<br />
								<br />
								<div align="right" style="padding-right:10px;">
								<input name="" type="button" class="l_bom03 font04" value="Add" onclick="javascript:choose('most_specialties','training_specialties')" >
								<input name="" type="button" class="l_bom03 font04" value="Cancel" onclick="document.getElementById('most_used_tags').style.display = 'none'"  />
								</div>
								</div>
                      			<div class="lcl_creden">
								<?php $_from = $this->_var['credentials']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>		
                        			<span><input name="credentials" id="credentials" type="checkbox" value="<?php echo $this->_var['value']['credentialsType']; ?>" onclick="javascript:choose('credentials','credentials_choose')"/>&nbsp;<?php echo $this->_var['value']['credentialsType']; ?></span>
								<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
									
                      			</div>								
                      			<div class="lcl_enterdd">
									<input name="credentials_choose" id="credentials_choose" type="hidden" class="lcl_tet" value="<?php echo $this->_var['profile']['credentials']; ?>"  style="width:180px; height:30px; font-size:11px;"  />	
									<!--<input name="" type="button" class="l_bom03 font04" value="Add" onclick="javascript:choose('credentials','credentials_choose')"  /> -->
									<script language="javascript">
									var str = "<?php echo $this->_var['profile']['credentials']; ?>";									
								   
									var temp = str.split(',');
									var creds = document.getElementsByName('credentials');
									
									for(var i=0; i < temp.length ; i++)
									{
										for(var j=0; j < creds.length ; j++)
										{
											if(temp[i] == creds[j].value)
											{
												creds[j].checked = 'checked';
											}
										}
									}
									
									</script>
								</div>
                    		</div>
                		</div>
                		<div class="right_biam">
                    		
                        		<!--<div class="lcl_didi" >
 -->						<div class="experign">Basic Personal Information</div>
 								<div>	
                        			<div class="lcl_didi_left" >
                            			<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">First Name*</div>
                                			<div class="lcl_didi_text"><input name="firstname" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['firstname']; ?>" /></div>
                                		</div>
                            			<div class="lcl_mari">
                                			<div class="lcl_didi_zi">Last Name*</div>
                                			<div class="lcl_didi_text"><input name="lastname" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['lastname']; ?>" /></div>
                               			</div>
                            			<div class="lcl_mari">
                                			<div class="lcl_didi_zi">Gender*</div>
                                			<div class="lcl_didi_text">
											<select id="gender" name="gender" class="lcl_tet" style="padding-top:5px;">
											<?php $_from = $this->_var['gender']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>	
											<option value="<?php echo $this->_var['value']['xid']; ?>" ><?php echo $this->_var['value']['genderType']; ?></option> 
											<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
											</select>
											<script>
											document.getElementById("gender").value="<?php echo $this->_var['profile']['gender']; ?>";
			  								</script>
											</div>
                                		</div>
                            			<div class="lcl_mari">
                                			<div class="lcl_didi_zi">Education Level</div>
                                			<div class="lcl_didi_text">
											<select id="education" name="education" class="lcl_tet" style="padding-top:5px;">
											<?php $_from = $this->_var['edulevel']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>	
											<option value="<?php echo $this->_var['value']['xid']; ?>" ><?php echo $this->_var['value']['eduLevel']; ?></option> 
											<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
											</select>
											<script>
											document.getElementById("education").value="<?php echo $this->_var['profile']['education']; ?>";
			  								</script>
											</div>
                                		</div>
                            			<div class="lcl_mari">
                                			<div class="lcl_didi_zi">School </div>
                                			<div class="lcl_didi_text">
											<input name="school" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['school']; ?>" />
											</div>
                                		</div>
                                		<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">Major</div>
                                			<div class="lcl_didi_text"><input name="major" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['major']; ?>" /></div>
                               			</div>
                            		</div>
                            		<div class="lcl_didi_right">
                            			<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">Business name<br /></div>
                                			<div class="lcl_didi_text">
											<input name="business_name" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['business_name']; ?>" />
											</div>
                                		</div>
                                		<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">Zip Code*</div>
                                			<div class="lcl_didi_text">
											<input name="zipcode" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['zipcode']; ?>" />
											</div>
                                		</div>
                                		<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">City*</div>
                                			<div class="lcl_didi_text">
											<input name="city" type="text" id="my_city"  class="lcl_tet" value="<?php echo $this->_var['profile']['address']; ?>"    onkeyup="showCityHint(this.value)" />
											 <div id="txtHintCity" style="position:absolute;width:201px;height:10px;z-index:2;">
											 </div>
											</div>
                                		</div>
                                		<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">State/Province*</div>
                                			<div class="lcl_didi_text">
											<input name="province" type="text" id="my_state"  class="lcl_tet" value="<?php echo $this->_var['profile']['province']; ?>" onkeyup="showStateHint(this.value)" />
											 <div id="txtHintState" style="position:absolute;width:201px;height:10px;z-index:2;">
											</div>
											</div>
                                		</div>
                                		<div  class="lcl_mari">
                                			<div class="lcl_didi_zi">Country*</div>
                                			<div class="lcl_didi_text">
											<input name="country" type="text" id="my_country"  class="lcl_tet" value="<?php echo $this->_var['profile']['country']; ?>" onkeyup="showCountryHint(this.value)" / >
											 <div id="txtHintCountry" style="position:absolute;width:201px;height:10px;z-index:2;">
											 </div>
											</div>
                                		</div>                               
                            		</div>
								</div>
 							</div>
                			<div class="right_biam">
                    			<div class="lcl_xinnav" style="line-height:31px;">
								<span class="experign">BIO*</span> <span class="font05">(Focus on your training experiences, philosophy)</span>
								</div>	
                  				<p class="experign">
								<textarea style="height:280px;width:710px;" id="BIO" name="BIO" maxlength="2000" ><?php echo $this->_var['profile']['BIO']; ?></textarea>
								</p>
							</div>
							<?php if ($this->_var['display_button'] == 1): ?>
							<div class="lcl_xinnav_con">
                        		<input name="save" type="submit" class="lcl_bimdd lcl_font" style="margin-left:140px; "  value="Save"/>
								<input name="save" type="submit" class="lcl_bimqw lcl_font" value="Save and Continue" style="background:url(themes/default/images/l_37.gif) no-repeat; width:188px; height:28px; line-height:28px; text-align:center; margin-left:10px; " />
								<input type="hidden" name="act" value="act_aboutme" />
							</div>
							<?php endif; ?>
							 
                		</div>
						
			  </form>
			</div>
       		</div>
			<div id="aboutme_warning_e" style=" position:absolute; top: 1200px; left:200px;color:#FF0000" >
						<!--Not saved: please fill up  <br />
						 all required fields -->
						</div>
						 
       		<?php echo $this->fetch('library/page_footer.lbi'); ?>	
<?php else: ?>
 	    <?php echo $this->fetch('library/page_header.lbi'); ?>
        <div class="l_nav">
            <div class="l_nav_con">
                <ul>
                    <li><a href="user.php">My dashboard</a></li>
                    <li><a href="projects.php?act=my_fitness_listings">My Fitness Listings</a></li>
                    <li><a href="user.php?act=profile" style="color: #FFFFFF; background-color: #CCCCCC" >Manage account</a></li>
                </ul>
            </div>
       </div>
       <div class="l_con">
       		<div class="right_posta" style="margin-top:20px;">
            	<ul >
					<li><a href="projects.php?act=add">Post your fitness needs</a></li>
                	<li><a href="projects.php?act=browse">Browse training projects</a></li>
                </ul>
      		</div>             
            <div class="lcl_con2">
            <form name="formAboutme_e" action="user.php" method="post" onSubmit="return edit_exerciser()" >
            	<div class="lcl_con2_left" >
                	<ul>
                   	  <li class="font03 lclaccount">Account management</li>
                        <li class="lcl_cin1 "><a href="user.php?act=profile" class="font91">Account info</a></li>
                      <li class="font03 lclaccount" >Profile management</li>
                        <li class="lcl_bim "><a href="user.php?act=aboutme" class="font90">About me</a></li>
                        <li class="lcl_sj"></li>
                        <li class="lcl_cin1 "><a href="user.php?act=photo" class="font91">Profile photos</a></li>
                        <li class="lcl_sj"></li>
                        <li class="lcl_cin2 font91" ><a href="user.php" class="font91">Profile completed,go<br />to my dashboard</a></li>
                    </ul>
                </div>
                <div class="lcl_con2_right">               	                    
                	<div class="" >
                    	<div class="lcl_xinnav font03">* Basic Personal Information</div>	
                        <div class="lcl_didi" >
                        	<div class="lcl_didi_left">
                            	<div  class="lcl_mari">
                                	<div class="lcl_didi_zi">First Name</div>
                                	<div class="lcl_didi_text"><input name="firstname" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['firstname']; ?>" /></div>
                                </div>
                            	<div class="lcl_mari">
                                	<div class="lcl_didi_zi">Last Name</div>
                                <div class="lcl_didi_text"><input name="lastname" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['lastname']; ?>" /></div>
                                </div>
                            	<div class="lcl_mari">
                                	<div class="lcl_didi_zi">Gender</div>
                                	<div class="lcl_didi_text" align="center">
									<select id="gender" name="gender" class="lcl_tet">
									<?php $_from = $this->_var['gender']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['value']):
?>	
									<option value="<?php echo $this->_var['value']['xid']; ?>" ><?php echo $this->_var['value']['genderType']; ?></option> 
									<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
									</select>
									<script>
									document.getElementById("gender").value="<?php echo $this->_var['profile']['gender']; ?>";
									</script>
									</div>
                           		</div>                                                                                      
                            </div>
                            <div class="lcl_didi_right">                          	
                                <div  class="lcl_mari">
                                	<div class="lcl_didi_zi">Zip Code</div>
                                	<div class="lcl_didi_text"><input name="zipcode" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['zipcode']; ?>" /></div>
                                </div>
                                <div  class="lcl_mari">
                                	<div class="lcl_didi_zi">City</div>
                                	<div class="lcl_didi_text"><input name="city" id="my_city" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['address']; ?>" onkeyup="showCityHint(this.value)" />
									 <div id="txtHintCity" style="position:absolute;width:201px;height:10px;z-index:2;">
									 </div>
									</div>
                                </div>
                                <div  class="lcl_mari">
                                	<div class="lcl_didi_zi">State/Province</div>
                                	<div class="lcl_didi_text"><input name="province" id="my_state" type="text" class="lcl_tet" value="<?php echo $this->_var['profile']['province']; ?>" onkeyup="showStateHint(this.value)" />
									 <div id="txtHintState" style="position:absolute;width:201px;height:10px;z-index:2;">
									 </div>
									</div>
                                </div>
                                <div  class="lcl_mari">
                                	<div class="lcl_didi_zi">Country</div>
                                	<div class="lcl_didi_text">
									<input name="country" type="text" class="lcl_tet" id="my_country" value="<?php echo $this->_var['profile']['country']; ?>" onkeyup="showCountryHint(this.value)" />
									 <div id="txtHintCountry" style="position:absolute;width:201px;height:10px;z-index:2;">
									 </div>
									
									</div>
                                </div>                               
                            </div>
							
                        </div>
						
					</div>     
					<div class="" style=" clear:both; margin-top:32px; margin-bottom:10px;">                  			
						<span class="lcl_xinnav font03">* BIO</span> 								                  				
						<textarea class="lcl_tet" style="height:100px;width:750px; " id="BIO" name="BIO" maxlength="2000" ><?php echo $this->_var['profile']['BIO']; ?></textarea>								
					</div>          
					<div class="lcl_xinnav_con023" style="margin-top:20px;">
                    	<input name="save" type="submit" class="lcl_bimdd lcl_font" style="margin-left:140px; "  value="Save"/>
						<input name="save" type="submit" class="lcl_bimqw lcl_font" value="Save and Continue" style="background:url(themes/default/images/l_37.gif) no-repeat; width:188px; height:28px; line-height:28px;  text-align:center; margin-left:10px;" />
						<input type="hidden" name="act" value="act_aboutme" />
						<input type="hidden" name="type" value="<?php echo $this->_var['info']['user_type']; ?>" />
					</div>
                </div>
              </form>
            </div>
       </div>
<div class="lcl_llin"></div>
<?php echo $this->fetch('library/page_footer.lbi'); ?>

<?php endif; ?>
</body>
<script type="text/javascript">
<?php $_from = $this->_var['lang']['clips_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>

var str = "<?php echo $this->_var['profile']['training_specialties']; ?>";
var temp = str.split(',');
var having_specialties_value = '';
for(var i=0; i < temp.length - 1; i++)
{
	having_specialties_value = having_specialties_value + "<span id=\'" +  temp[i] + "\' >" + "<img name='specialties[]' src='themes/default/images/l_38.gif' " + " onclick=\"delete_specialties(\'" + temp[i] + "\')" + "\">" + temp[i] + " </img></span> ";
}
document.getElementById('specialties').innerHTML = having_specialties_value;
document.getElementById('training_specialties_value').value = str;

var xmlHttp

function showCityHint(str)
{
	
if (str.length==0)
  { 
  document.getElementById("txtHintCity").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="projects.php"
url=url+"?act=act_get_city&q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=cityChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function showStateHint(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHintState").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="projects.php"
url=url+"?act=act_get_state&q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function showCountryHint(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHintCountry").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="projects.php"
url=url+"?act=act_get_country&q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=countryChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function cityChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHintCity").style.display = 'block'
 document.getElementById("txtHintCity").innerHTML=xmlHttp.responseText 
 } 
}

function hideNameCity()
{
	
	document.getElementById("txtHintCity").style.display = 'none'
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHintState").style.display = 'block'
 document.getElementById("txtHintState").innerHTML=xmlHttp.responseText 
 } 
}

function hideNameState()
{
	
	document.getElementById("txtHintState").style.display = 'none'
}

function countryChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHintCountry").style.display = 'block'
 document.getElementById("txtHintCountry").innerHTML=xmlHttp.responseText 
 } 
}

function hideNameCountry()
{
	
	document.getElementById("txtHintCountry").style.display = 'none'
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function choose(name,id)
{
	var special = document.getElementsByName(name);
	var value = document.getElementById(id).value;	
	for( var i=0; i < special.length; i++)
	{		
		if(special[i].checked)
		{		
			if((value.indexOf(special[i].value)) == -1)
			{
         		value= value + special[i].value+",";
			}
			
        }
		else
		{
			value = value.replace(special[i].value + ',', "");
		}
	}	
	document.getElementById(id).value = value;
}


function add_specialties()
{
	var add_value = document.getElementById('training_specialties').value;
	var having_value = "<?php echo $this->_var['profile']['training_specialties']; ?>";
	var specialties_value = document.getElementById('specialties').innerHTML;
	
	var add_value_temp = add_value.split(',');
	for( var i=0; i < add_value_temp.length -1 ; i++)
	{
		if(specialties_value.indexOf(add_value_temp[i]) == -1)
		{
			having_value = having_value + add_value_temp[i] + ",";
			specialties_value = specialties_value + "<span id=\'" + add_value_temp[i] + "\' >" + "<img name='specialties[]' src='themes/default/images/l_38.gif' " + " onclick=\"delete_specialties(\'" + add_value_temp[i] + "\')" + "\">" + add_value_temp[i] + " </img></span> ";
		}	
	}
	
	var i = add_value_temp.length - 1;
	if(specialties_value.indexOf(add_value_temp[i]) == -1)
	{
		having_value = having_value + add_value_temp[i] + ",";
		specialties_value = specialties_value + "<span id=\'" + add_value_temp[i] + "\' >" + "<img name='specialties[]' src='themes/default/images/l_38.gif' " + " onclick=\"delete_specialties(\'" + add_value_temp[i] + "\')" + "\">" + add_value_temp[i] + " </img></span> ";
	}
	
	document.getElementById('training_specialties_value').value = having_value;
	document.getElementById('specialties').innerHTML = specialties_value;
}

function delete_specialties(child)
{
	var parent = document.getElementById('specialties');
	var delete_child = document.getElementById(child);
	var value = document.getElementById('training_specialties_value').value;
	var tmp = value.replace(child+',', " ");
	document.getElementById('training_specialties_value').value = tmp;
	delete_child.innerHTML = "";
	parent.removeChild(delete_child);
}

function  jtrim(s)  
{ 
  var  i,b=0,e=s.length;  
  for(i=0;i<s.length;i++) //去左空格
    if(s.charAt(i)!=' '){b=i;break;}  
  if(i==s.length)  
    return  "";  

  for(i=s.length-1;i>b;i--) //去右空格
    if(s.charAt(i)!=' '){e=i;break;}  
  return  s.substring(b,e+1);  
}


function most_tags()
{
	document.getElementById('most_used_tags').style.display = "block";
}



/* exerciser会员修改个人信息 */
function edit_exerciser()
{
  var frm              = document.forms['formAboutme_e'];
  var firstname        = frm.elements['firstname'].value;
  var lastname         = frm.elements['lastname'].value;
  var zipcode          = frm.elements['zipcode'].value;
   
  if(frm.elements['city'].value == '')
  {
  	var city     	   = frm.elements['city'].value; 
  }
  else
  {
  	var city     	   = jtrim(frm.elements['city'].value.toLowerCase()); 	
  }

  if(frm.elements['province'].value == '')
  {
  	var province       = frm.elements['province'].value;
  }
  else
  {
    var province       = jtrim(frm.elements['province'].value.toLowerCase());
  }
  
  if(frm.elements['country'].value == '')
  {
    var country        = frm.elements['country'].value;
  }
  else
  {
    var country        = jtrim(frm.elements['country'].value.toLowerCase());  
  } 

  var BIO     	       = frm.elements['BIO'].value;  
  var msg = '';
  var reg = null;

  if ((firstname.length == 0) || (lastname.length == 0 ) || (zipcode.length == 0 ) || (city.length == 0 ) || (province.length == 0 ) || (country.length == 0 )  || (BIO.length == 0 ) )
  {
    msg += 'Not saved: please fill up all required fields ';	
	//document.getElementById('aboutme_warning_e').innerHTML = msg;
  }
  
  var citys = "<?php echo $this->_var['citys']; ?>".toLowerCase();
  var states = "<?php echo $this->_var['states']; ?>".toLowerCase();
  var countrys = "<?php echo $this->_var['countrys']; ?>".toLowerCase();

  if((citys.indexOf(city))== -1)
  {
  	msg += '\r\n There is no such city ' + city;
  }
  if((states.indexOf(province))== -1)
  {
  	msg += '\r\n There is no such state ' + province;
  }
  if((countrys.indexOf(country))== -1)
  {
  	msg += '\r\n There is no such country ' + country;
  }
  

  if (msg.length > 0)
  {
    alert(msg);
    return false;
  }
  else
  {
    return true;
  }
}

/* trainer会员修改个人信息 */
function edit_trainer()
{
	
  var frm              = document.forms['formAboutme_t'];
  var training_specialties_value = frm.elements['training_specialties_value'].value;
  var firstname        = frm.elements['firstname'].value;
  var lastname         = frm.elements['lastname'].value;
  var zipcode          = frm.elements['zipcode'].value;
  //var school           = frm.elements['school'].value;
  //var major            = frm.elements['major'].value;
  
  if(frm.elements['city'].value == '')
  {
  	var city     	   = frm.elements['city'].value; 
  }
  else
  {
  	var city     	   = jtrim(frm.elements['city'].value.toLowerCase()); 
  }
  
  if(frm.elements['province'].value == '')
  {
  	var province       = frm.elements['province'].value;
  }
  else
  {
    var province       = jtrim(frm.elements['province'].value.toLowerCase());
  }
  
  if(frm.elements['country'].value == '')
  {
    var country        = frm.elements['country'].value;
  }
  else
  {
    var country        = jtrim(frm.elements['country'].value.toLowerCase());  
  } 
 
  //if(frm.elements['school'].value == '')
  //{
  //  var school        = frm.elements['school'].value;
  //}
  //else
  //{
  //  var school        = jtrim(frm.elements['school'].value.toLowerCase());  
  //}
  
  //if(frm.elements['major'].value == '')
  //{
  //  var major        = frm.elements['major'].value;
  //}
  //else
  //{
  // var major        = jtrim(frm.elements['major'].value.toLowerCase());  
  //}  

 
  var BIO     	       = frm.elements['BIO'].value;
  var msg = '';
  var reg = null;

  if ((training_specialties_value.length == 0) || (firstname.length == 0) || (lastname.length == 0 ) || (zipcode.length == 0 ) || (city.length == 0 ) || (province.length == 0 ) || (country.length == 0 ) || (BIO.length == 0 ))
  {
    msg += 'Not saved: please fill up \r\n all required fields ';
  }

  var citys = "<?php echo $this->_var['citys']; ?>".toLowerCase();
  var states = "<?php echo $this->_var['states']; ?>".toLowerCase();
  var countrys = "<?php echo $this->_var['countrys']; ?>".toLowerCase();
  if((citys.indexOf(city))== -1)
  {
  	msg += '\r\n There is no such city ' + city;
  }
  if((states.indexOf(province))== -1)
  {
  	msg += '\r\n There is no such state ' + province;
  }
  if((countrys.indexOf(country))== -1)
  {
  	msg += '\r\n There is no such country ' + country;
  }
 
  var special = document.getElementsByName('credentials');
  var value = document.getElementById('credentials_choose').value;	

	for( var i=0; i < special.length; i++)
	{		
		if(special[i].checked)
		{		
			if((value.indexOf(special[i].value)) == -1)
			{
         		value= value + special[i].value+".";
			}
				 
        }
	}	
	document.getElementById('credentials_choose').value = value;

  if (msg.length > 0)
  {
    alert(msg);
    return false;
  }
  else
  {
    return true;
  }
}

function get_city_string(obj) 
{
  
  document.getElementById("my_city").value = obj.innerHTML;
  document.getElementById("txtHintCity").style.display = 'none';
}

function get_state_string(obj) 
{
  
  document.getElementById("my_state").value = obj.innerHTML;
  document.getElementById("txtHintState").style.display = 'none';
}

function get_country_string(obj) 
{
  
  document.getElementById("my_country").value = obj.innerHTML;
  document.getElementById("txtHintCountry").style.display = 'none';
}

function change_color(obj) 
{
	
  obj.style.background= "#00CCFF";
}

function back_color(obj) 
{
	
  obj.style.background= "#F2F2F2";
}

</script>
</html>
